package IC.Parser;

public class LexicalError extends Exception
{
	
	private static final long serialVersionUID = -5897442124706060723L;
	private String message = "";
	private Integer line = 0;
	
	/**
	 * Constructor
	 * @param msg - Error message
	 */
    public LexicalError(String msg) {
	   message = msg;
    }
    
	/**
	 * Constructor
	 * @param msg - Error message	  
	 * @param line - Line number
	 */
    public LexicalError(String msg, int line) {
    	message = msg;
	    this.line = line;
    }
    public String toString() {
    
    	if (line != 0)
    		return line.toString() + ": " + message;
    	return message;
    }
}

